function selectedEntriesCount(){
	var count = 0;
	jQuery("input[class=entry_checkbox]:checked").each
	(function(){
		count++;
	});
	return count;
}


function  get_selected_entry_exe(entry){
	return entry[0];
}
function  get_selected_entry_url(entry){
	return entry[2];
	
	
}
function  get_selected_entry_title(entry){
	return entry[1];
	
	
}

function get_json_entry_info_from_db(entryType, entryId){
	$.getJSON('/entries/get_info',{ entry_id: entryId, entry_type: entryType },function(data) {
	alert(data);
	
	
	
	});
}


function get_plain_info_from_db(entryType, entryId){
	var entry=new Array();
	
	$.get("/entries/get_info" ,{ entry_id: entryId, entry_type: entryType },
	function(data){
		array = data.split(",")
		
		if (array[1] != "null")
		
			$("#entry_exe").val(array[1]);
			if (array[2] != "null")

			$("#entry_url").val(array[2]);
			if (array[0] != "null")

			$("#entry_title").val(array[0]);
		
	});
	return entry;
}





function get_first_selected_entry(){
	entryType = "";
	entryId = ""; 
	jQuery("input[type=checkbox]:checked").each
	(function(){
		entryId = this.value
		entryType = this.id
	});
	get_plain_info_from_db(entryType, entryId);
}


function flash_notice(){
	var msg = "<div class=\"notice\"><img src=\"/images/famfamfam/flag_blue.png\">";
	msg += "No Timestamps selected.<span class=\"close_flash\"></span></div>";	
	$(".top-flash").html(msg);
}


$(function () {
	$("#delete_entries_button").click(function(){
		var count = selectedEntriesCount();
		if (count > 0){
		$.blockUI(); 
		var request_data = add_category_info(this);
		$.post('/entries/ajax_delete',
		request_data, null, 'script');
		//return false;
	}else{
		flash_notice();
		
	}
		
	});
});